home *** CD-ROM | disk | FTP | other *** search
- Path: newsfeeds.ans.net!btco!btco3!newsadm
- From: Dave Mx
- Newsgroups: comp.lang.c
- Subject: How do I use abs() on floats ?
- Date: 22 Feb 1996 11:37:36 GMT
- Organization: Bank
- Message-ID: <4ghki0$b44@LNCSEX0003.eu.btco.com>
- NNTP-Posting-Host: lngibw1334.eu.btco.com
- X-Newsreader: SPRY News 3.03 (SPRY, Inc.)
-
- What's the easiest way to get the absolute scalar value of a float.
- I need to test to see of a variable is 'bigger' than a certain tolerance.
-
- e.g.
-
- if ( abs (error__float) > MAX_TOLERANCE ) printf ( "Tolerance level exceeded \n" );
-
-
- BUT the abs() function says it only works on int 's . Any ideas how to do it for floats in the most elegant way ???
-